<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>逻辑运算</title>
  </head>
  <body>
    <!-- 
    a && b      a与b都为true时 a且b的结果才为true
    a || b      a、b中但凡有一个为true时 a或b的结果就为true     
    !a          对a取反 a成立则!a一定不成立 a不成立则!a一定成立 逻辑非拥有最高优先级
     -->
    <script>
      var a = 1 + 1 === 2; //true
      var b = 1 + 1 !== 2; //false

      console.log("a且b", a && b); //false
      console.log("a或b", a || b); //true
      console.log("非a", !a); //false
      console.log("非b", !b); //true
    </script>
  </body>
</html>
